import { defineStore } from 'pinia'
import { Names } from './store-name'
export const useTestStore = defineStore(Names.TEST, {
  // () => { return { xxx } } === () => ({ xxx })
  state: () => ({
    current: 1000,
    name: '大傻子',
    list: {}
  }),
  // 有缓存的，修饰一些值
  getters: {

  },
  // 可以做同步、异步操作，提交 state
  actions: {
    async getList() {
      const result = await getApiList()
      this.list = result
      console.log(result)
    }
  }
})